<template>
  <div style="width: 232px">
    <div class="cover" :style="img" @click="handleClick">
      <div class="playCount">
        <svg-icon icon-class="views"></svg-icon>{{ data.playCount }}
      </div>
    </div>
    <div class="content-text">{{ data.name }}</div>
  </div>
</template>

<script>
export default {
  name: 'PlayList',
  props: {
    data: {
      type: Object,
      required: true,
    },
  },
  computed: {
    img() {
      return { 'background-image': 'url("' + this.data.coverImgUrl + '")' }
    },
  },
  methods: {
   handleClick(){
     this.$emit('click', this.data)
   }
  }
}
</script>

<style lang="scss" scoped>
.cover {
  height: 220px;
  border-radius: 4px;
  background-size: 100%;
  cursor: pointer;
  .playCount {
    height: 30px;
    width: 100%;
    background: linear-gradient(to right, transparent, #ccc);
    text-align: right;
    padding: 5px;
  }
}
.content-text {
  font-size: 14px;
  font-weight: 600;
}
</style>
